package com.quotes.simulation;

import java.util.Date;
import java.util.TreeMap;

import com.quotes.datamodell.BuySell;
import com.quotes.datamodell.Symbol;

public class MarketOrder 
{
	private Symbol symbol;
	private Date date = null;
	private BuySell buySell;
	private double price;
	private int count;
	private double stopLossPrice;
	private TreeMap<String, Double> info = new TreeMap<String, Double>();

	public MarketOrder(Symbol symbol, Date date, BuySell buySell) {
		this.symbol = symbol;
		this.date = date;
		this.buySell = buySell;
	}
	
	public MarketOrder(Symbol symbol, Date date, BuySell buySell, double price) {
		this.symbol = symbol;
		this.date = date;
		this.buySell = buySell;
		this.price = price;
	}
	
	public MarketOrder(Symbol symbol, Date date, BuySell buySell, double price, int count, double stopLossPrice) {
		this.symbol = symbol;
		this.date = date;
		this.buySell = buySell;
		this.price = price;
		this.count = count;
		this.stopLossPrice = stopLossPrice;
	}
	
	public void addInfo(String key, double value) {
		info.put(key, value);
	}
	
	public double getInfo(String key) {
		return info.get(key);
	}
	
	public Date getDate() {
		return date;
	}
	
	public void setDate(Date date) {
		this.date = date;
	}

	public BuySell getBuySell() {
		return buySell;
	}

	public double getPrice() {
		return price;
	}
	
	public void setPrice(double price) {
		this.price = price;
	}
	
	public Symbol getSymbol() {
		return symbol;
	}
	
	public int getCount() {
		return count;
	}
	
	public void setCount(int count) {
		this.count = count;
	}
	
	public double getStopLossPrice() {
		return stopLossPrice;
	}
	
	public void setStopLossPrice(double stopLossPrice) {
		this.stopLossPrice = stopLossPrice;
	}
	
	public double getValue() {
		return count * price;
	}
}
